package tcpdemo.tcptest;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

public class Client {
    public static void main(String[] args) throws IOException {
        // 创建客户端Socket对象
        // Socket()创建流
        Socket s = new Socket("127.0.0.1", 10000);

        // 获取输出流，写入数据
        OutputStream os = s.getOutputStream();
        os.write("不去".getBytes());

        // 释放资源
        os.close();
        s.close();
    }
}
